﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using COM.OA.BLL;
using COM.OA.Entity;
using System.Collections.Generic;

public partial class linminchao_ceshi : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        users loginuser = Session["loginuser"] as users;
        if (loginuser == null)
        {
            this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../../login.aspx"));
        }
        else
        {
            IList<news> newsList = newsBLL.Select();
            if (newsList.Count != 0)
            {
                this.Response.Write("<body>");
                this.Response.Write("<div align='center'>");
                this.Response.Write("<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td><form name='form1' method='post' action='lialljiaoxuequery.asp' onSubmit='return dis()'><table width='96%' border='0' cellspacing='0' cellpadding='0'><tr><td width='32%' valign='middle'>&nbsp;</td><td width='47%' valign='middle'><div align='right'><div align='right'><input name='q' type='text' id='q'><input name='submit' type=submit id='submit' style='FONT-SIZE: 12px; HEIGHT: 24px' value=' 查 询 '></div><td width='4%'><div align='right'><span class='style4'><img src='../img/txl/16.gif' width='16' height='16'></span></div></td><td width='7%'><a href='writejiaoxue.asp'>发布新闻</a></td><td width='2%'><img src='../img/txl/12.gif' width='16' height='16'></td><td width='8%'><a href='listbwanglu.asp'>新闻管理</a></td></tr></table></form></td></tr></table><table width='98.5%' border='0' cellpadding='3' cellspacing='1'><tr><td><div class='RoundedCorner'><div align='center'><b class='rtop'><b class='r1'></b><b class='r2'></b><b class='r3'></b><b class='r4'></b></b> <span class='style1'>浏 览 新 闻</span></div></div></td></tr></table></div><div align='center'><table width='98%' border='0' cellpadding='3' cellspacing='1' bgcolor='#5AAE18'><tr bgcolor='#FFFFFF'><td colspan='4'>&nbsp;<a href='listbwanglutype.asp?t=总经理室'>总经理室</a></td></tr><tr bgcolor='#FFFFFF'><td><strong>标 题</strong>　</td><td width='8%'><div align='center'><strong>发布人</strong></div></td><td width='8%'><div align='center'><strong>部 门</strong></div></td><td width='20%'><div align='center'><strong>时 间</strong></div></td></tr>");
                foreach (news d in newsList)
                {
                    users u = usersBLL.Select(d.n_u_id);
                    department dept = departmentBLL.Select(d.n_dept_id);
                    this.Response.Write("<tr bgcolor='#FFFFFF'><td><a href='gw_documentinfo.aspx?newsid=" + d.n_id + "'>" + d.n_title + "<font color='#999999'>" + d.n_releasetime + "</font>" + "</a></td><td width='8%'>" + u.u_username + "</td><td width='8%'>" + dept.dept_department + "</td><td width='20%'>" + d.n_releasetime + "</td>");
                }
            }
            else
            {
                this.Response.Write("<tr><td colspan='3' align='left'><span class='style1'>对不起，没有你要查找的数据！！</span></td></tr>");
            }
            this.Response.Write("</table>");
            this.Response.Write("</div>");
            this.Response.Write("</body>");
        }
    }

}
